package com.yexiao.cofe.constant;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author lkl
 * @since 2025/4/1
 */
public class OrderConstant {

    /**
     * 订单状态
     * 0-待支付  创建订单后的默认状态
     * 1-已支付  支付后的状态，订单会流转到商家
     * 2-制作中  商家接单后的状态
     * 3-待取餐  商家制作完成的状态
     * 10-已完成  取餐后的状态
     * 4-已取消  由于各种原因导致订单取消
     */
    public static final int Order_Status_Waiting_pay = 0;
    public static final int Order_Status_finish_pay = 1;
    public static final int Order_Status_Making = 2;
    public static final int Order_Status_Waiting_pick = 3;
    public static final int Order_Status_finish = 10;
    public static final int Order_Status_canceled = 4;

    // 状态集
    public static final List<Integer> statusList = Arrays.asList(
            Order_Status_Waiting_pay,
            Order_Status_finish_pay,
            Order_Status_Making,
            Order_Status_Waiting_pick,
            Order_Status_finish,
            Order_Status_canceled
    );

    public static final Map<Integer, Integer> preStatusMap = new HashMap<Integer, Integer>();
    static {
        preStatusMap.put(Order_Status_finish_pay, Order_Status_Waiting_pay);
        preStatusMap.put(Order_Status_Making, Order_Status_finish_pay);
        preStatusMap.put(Order_Status_Waiting_pick, Order_Status_Making);
        preStatusMap.put(Order_Status_finish, Order_Status_Waiting_pick);
        preStatusMap.put(Order_Status_canceled, Order_Status_Waiting_pay); // 超时未支付
    }

    /**
     * 是否删除
     * 0-否
     * 1-是
     */
    public static final int Order_Not_Del = 0;
    public static final int Order_Have_Del = 1;
}
